﻿<include file="Public/header"/>
<include file="Public/menu"/>
<div class="page-content">
	<div class="page-header">
		<h1>
			用户管理
			<small>
				<i class="icon-double-angle-right"></i>
				<eq name="Think.ACTION_NAME" value="edit">修改用户信息<else/>添加用户信息</eq>
			</small>
		</h1>
	</div>
	<!-- /.page-header -->
	<!-- PAGE CONTENT BEGINS -->
	<div class="row">
		<div class="col-xs-12">
			<div class="row">
				<div class="tabbable">
					<ul class="nav nav-tabs" id="myTab">
						<li>
							<a href="{:U('User/index')}">
								<i class="green icon-home bigger-110"></i>
								用户列表
							</a>
						</li>
						<li class="active">
							<a >
								<i class="green icon-edit bigger-110"></i>
								<eq name="Think.ACTION_NAME" value="edit">修改用户信息<else/>添加用户信息</eq>
							</a>
						</li>
					</ul>
					<div class="tab-content">
						<div class="tab-pane in active">
							<form  id="ajaxForm" class="form-horizontal" action="{:U('User/insert')}" method="post" enctype="multipart/form-data">

								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">用户类型</label>
									<div class="col-sm-2">
										<select class=" width-80 form-control" name="usertype">
											<option value="">全部分类</option>
											<option value="1">个人用户</option>
											<option value="2">企业用户</option>
										</select>
									</div>
								</div>

								<div class="space-4"></div>

								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right" > 账号 </label>
									<div class="col-sm-9">
										<input type="text"  name="username" placeholder="请输入账号" class="col-xs-10 col-sm-5" value=""/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right" > 密码 </label>
									<div class="col-sm-9">
										<input type="password" name="password" class="col-xs-10 col-sm-5"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right" > 用户昵称 </label>
									<div class="col-sm-9">
										<input type="text"  name="alias" class="col-xs-10 col-sm-5"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right" > email </label>
									<div class="col-sm-9">
										<input type="text"  name="email" class="col-xs-10 col-sm-5"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right" > 电话/手机 </label>
									<div class="col-sm-9">
										<input type="text"  name="phone" class="col-xs-10 col-sm-5"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right" > 上传头像 </label>
									<div class="col-sm-9">
										<input type="file"  name="photo" class="col-xs-10 col-sm-5"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right" > 状态</label>
									<div class="col-sm-2">
										<input type="radio" name="status" class="ace" value="1" checked />
										<span class="lbl"> 正常 </span>
										<input  type="radio" name="status" class="ace"/>
										<span class="lbl"> 禁用 </span>
									</div>
								</div>

								<div class="space-4"></div>

								<div class="clearfix form-actions">
									<div class="col-md-offset-3 col-md-9">
										<button class="btn btn-info" type="submit">
											<i class="icon-ok bigger-110"></i>
											提交
										</button>

										&nbsp; &nbsp; &nbsp;
										<button class="btn" type="button">
											<i class="icon-undo bigger-110"></i>
											返回
										</button>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- PAGE CONTENT END -->
</div>
</div>
</div>

<!-- inline scripts related to this page -->
<script type="text/javascript">
	seajs.use(['$','bootstrap-min','bootbox','form-ajax'],function($){
		var ajaxFrom = $('#ajaxForm');
		ajaxFrom.ajaxForm({
			dataType:'json',
			success:function(data){
				/*返回值包含状态，信息和要跳转的url*/
				if(data.status > 0  && data.url){
					window.location.href = data.url;
					return false;
				}else{
					bootbox.alert({
						message:data.info,
						title: "提示信息"
					});
					return false;
				}
			}
		})
	});
</script>
<include file="Public/footer"/>

